package org.iweb.html.impl.js;

import org.iweb.html.api.JFunction;

public class Ajax extends JFunction {

	
	public JFunction post(String url,JFunction onSuccess,JFunction onFailure,String data){
		String body="function(){$.ajax({type: 'POST',url: '"+url+"',data: '"+data+"',success: "+onSuccess.getBodyFunction()+",error:"+onFailure.getBodyFunction()+", dataType: 'html'});}";
		setBodyFunction(body);
		return this;
	}
	
	
}
